<jsp:include page="template-top.jsp" />
<%@ page import="edu.cmu.ibill.databeans.User" %>
<%@ page import="java.text.DecimalFormat" %>
<%@ page import="java.util.HashMap" %>


<!-- user setting page here -->
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/accountsetting.css">

<%
DecimalFormat f = new DecimalFormat("0.00");
double e = (Double)(request.getAttribute("monthlyExpense"));
double i = (Double)(request.getAttribute("monthlyIncome"));
String expense = f.format(e);
String income = f.format(i);


String needToCollect = f.format((Double)request.getAttribute("needToCollect")); 
String needToReturn = f.format((Double)request.getAttribute("needToReturn")); 

%>


<div style="background:#009ACD; width:880px;" align="left">
<br>
<br>

<b><font size="9" style="color:white">&nbsp;&nbsp;&nbsp;Your Account Summary</font></b>

<br>
<br>
</div>
<br>

<div style="background:#FFFFFF; width:880px;" align="left">
<br><br><font size="6"><b>&nbsp;For Personal Bills: </b></font>
<br><br>
<font size="5" >&nbsp;&nbsp;&nbsp;Your expense during this month is </font> <font size="5" style="color:#FF8C00"><%= expense %></font>
<br><br>
<font size="5">&nbsp;&nbsp;&nbsp;Your income during this month is </font> <font size="5" style="color:#4169E1"><%= income %></font>
<br><br>

<div style="background:#696969; width:880px; height:2px"></div>


<br><br>
<font size="6"><b> &nbsp;For Shared Bills and Loans: </b></font>
<br><br>
<font size="5" >&nbsp;&nbsp;&nbsp;You need to return </font> <font size="5" style="color:#FF8C00"><%= needToReturn %> </font>
<br><br>
<font size="5" >&nbsp;&nbsp;&nbsp;You need to collect </font> <font size="5" style="color:#4169E1"><%= needToCollect %> </font>

<br>
<br>
<br>

<%
HashMap<String, Double> map = (HashMap<String, Double>) request.getAttribute("debtSummary");
%>

<%if(map.size()>0)
{
%>
<table align="center" border="1">
<tr><td style="width:240px"><font size="5"><b>People</b></font></td><td style="width:120px"><font size="5"><b>Amount</b></font></td></tr>

<%
for(String user:map.keySet())
{
Double amount = map.get(user);
String value = f.format(amount);
%>
<tr><td><font size="4"> <%=user%></font> </td><td> <font size="4"><%=value%></font>  </td></tr>

<%
}
%>


</table>

<div align="right"> <font size="2"> * Note: Positive number means you need to return money to that person.<br>
Negative number means you need to collect money from that person.</font></div>


<%
}
%>




<br>
<br>

<br>

</div>
<br>


















<jsp:include page="template-bottom.jsp" />